package com.mr.dao.entity.admin;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import com.mr.constants.Tables;
import com.mr.constants.enumeration.UserType;
import com.mr.dao.entity.BaseEntity;
import com.mr.dao.entity.customer.Order;

@Entity(name = Tables.USER)
public class User extends BaseEntity {
	private static final long serialVersionUID = 2170447272046544884L;
	@Enumerated
	private UserType user_type;
	private String email;
	private String user_id;
	private String password;
	private String first_name;
	private String last_name;
	@OneToMany(mappedBy = "admin_user", cascade = CascadeType.ALL)
	private List<Order> orders = new ArrayList<Order>(0);
	@OneToOne(mappedBy = "admin_user", cascade = CascadeType.ALL)
	private UserDetails userDetails;

	public UserType getUser_type() {
		return user_type;
	}

	public void setUser_type(UserType user_type) {
		this.user_type = user_type;
	}

	public String getUser_id() {
		return user_id;
	}

	public void setUser_id(String user_id) {
		this.user_id = user_id;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getFirst_name() {
		return first_name;
	}

	public void setFirst_name(String first_name) {
		this.first_name = first_name;
	}

	public String getLast_name() {
		return last_name;
	}

	public void setLast_name(String last_name) {
		this.last_name = last_name;
	}

	public List<Order> getOrders() {
		return orders;
	}

	public void setOrders(List<Order> orders) {
		this.orders = orders;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public UserDetails getUserDetails() {
		return userDetails;
	}

	public void setUserDetails(UserDetails userDetails) {
		this.userDetails = userDetails;
	}
}
